<?php
// +----------------------------------------------------------------------
// | 幕小铺
// +----------------------------------------------------------------------
// | 版权所有 2016~2020 幕小铺科技（大连）有限公司
// +----------------------------------------------------------------------
// | 2020/03/14
// +----------------------------------------------------------------------

namespace app\video\model;

use think\Model;

/**
 * 我 首页推送 模型
 * @package app\user_center\model
 */
class VideoPlayIndexpush extends Model
{
    // 设置当前模型对应的完整数据表名称
    protected $table = 'xm_video_play_indexpush';

    /**
     * 添加数据
     * @param int $uid 用户id
     * @param int $play_id 视频id
     * @author jason wang <120907037@qq.com>
     * @return bool
     */
    public function addData($uid, $play_id, $play_type){
        $data['uid'] = $uid;
        $data['play_id'] = $play_id;
        $data['play_type'] = $play_type;
        $res = $this -> isUpdate(false) ->data($data, true) -> save();//添加  thinkp 主键bug
        if($res){
            return array_out(200, 'success');
        }else{
            return array_out(-1001, 'error');
        }
    }
}
